import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2023 —10 —22
 * Time: 17:38
 */
public class test_10_22 {
/*

    //多数元素:数组中出现次数最多的元素的个数大于数组元素个数/2
    //默认给定的数组中必然存在多数元素
    //
    public static void main(String[] args) {
        int [] array = {1,2,3,4,2,2,3,2,2,2,2,2,2};
        System.out.println(func(array));

    }

    public static int func(int [] array1){
        Arrays.sort(array1);
        int n = array1[array1.length/2];
        return n;
    }
*/

/*

    //判断数组中是否存在三个连续的奇数
    public static void main(String[] args) {
        int[] array = {12,3213,213,213,4,213,431,5,7,9,2};
        System.out.println(func1(array));
    }
    public static boolean func1(int[] array1){
        int count = 0;
        for (int i = 0; i < array1.length; i++) {
            if(array1[i] % 2 != 0){
                count ++ ;
                if (count == 3){
                    return true;
                }
            }
            else{
                count = 0;
            }
        }
        return false;
    }

*/


}
